package com.ajz.manager.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.springframework.format.annotation.DateTimeFormat;

import com.ajz.common.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 
 * <p>
 * 订单中心
 * </p>
 *
 * @author xyj
 * @date 2018年7月4日
 */
@Entity
public class OrdOrder extends BaseEntity<String> {
	
	private String title; // 订单标题
	
	private String contactsPhone; // 联系电话

	private String contactsName; // 联系人

	private String contactsAddress;// 地址
	
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date StartTime; // 开工时间

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date EndTime; // 竣工时间
	
	private BigDecimal price; // 预计价格
	
	@Column(columnDefinition = "Text")
	private String introduce; // 施工内容
	
	private status status; // 订单状态（0审核中，1通过，2拒绝）
	
	public enum status{
		wait,open,reject
	}
	
	private serviceStatus serviceStatus; // 订单状态（0未开始,1进行中，2完成，3取消）
	
	public enum serviceStatus{
		unstart,underway,finish,cancel
	}
	@ManyToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH })
	@JoinColumn(name = "userid")
	private Occupation occupation; // 装修类型
	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContactsPhone() {
		return contactsPhone;
	}
	public void setContactsPhone(String contactsPhone) {
		this.contactsPhone = contactsPhone;
	}
	public String getContactsName() {
		return contactsName;
	}
	public void setContactsName(String contactsName) {
		this.contactsName = contactsName;
	}
	public String getContactsAddress() {
		return contactsAddress;
	}
	public void setContactsAddress(String contactsAddress) {
		this.contactsAddress = contactsAddress;
	}
	public Date getStartTime() {
		return StartTime;
	}
	public void setStartTime(Date startTime) {
		StartTime = startTime;
	}
	public Date getEndTime() {
		return EndTime;
	}
	public void setEndTime(Date endTime) {
		EndTime = endTime;
	}
	public BigDecimal getPrice() {
		return price;
	}
	public void setPrice(BigDecimal price) {
		this.price = price;
	}
	public String getIntroduce() {
		return introduce;
	}
	public void setIntroduce(String introduce) {
		this.introduce = introduce;
	}
	public status getStatus() {
		return status;
	}
	public void setStatus(status status) {
		this.status = status;
	}
	public serviceStatus getServiceStatus() {
		return serviceStatus;
	}
	public void setServiceStatus(serviceStatus serviceStatus) {
		this.serviceStatus = serviceStatus;
	}
}
